<script setup>
import {useThemeStore} from "@/stores/theme.js";
import {storeToRefs} from "pinia";
import {showNotify} from "vant";
import {onMounted, onUnmounted} from "vue";

const themeStore = useThemeStore();
const {theme} = storeToRefs(themeStore);
const offlineToast = () => {
  showNotify({message: '网络连接断开'});
}
onMounted(() => {

})

onUnmounted(() => {
  window.addEventListener('offline', offlineToast)
})


</script>

<template>
  <van-config-provider :theme="theme">
    <router-view/>
  </van-config-provider>
</template>
